<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>预约练车</title>
<%@ include file="/WEB-INF/layouts/comm/datatables.jsp"%>
<%@ include file="/WEB-INF/layouts/comm/kindeditor.jsp"%>
<%@ include file="/WEB-INF/layouts/comm/form.jsp"%>
</head>
<body>
	<div class="mod_header">
		<div class="title">
			<h2 id="h_title">预约练车</h2>
		</div>
	</div>
	<ol class="breadcrumb">
		<li><a href="#">功能设置</a></li>
		<li class="active">预约练车报名</li>
	</ol>
	<div class="mod_basic">
		<div class="title">
			<h3>预约练车报名</h3>
		</div>

		<div class="content">
			<div class="sub_content_table_tool">
				<div class="sub_header">
					<div class="sub_bar">
						<form class="form-inline">
							<div class="form-group">
								<a href="${ctx}/webCustomer/coach/coachConfig"
									class="btn btn-primary "><i class="fa fa-plus"></i> 预约练车设置</a>
							</div>
							<div class="form-group">
								<input type="text" class="form-control" id="key" name="key"
									style="width: 200px;" placeholder="教练/学员/电话/预约时间"
									value="${cc.keyName}">
							</div>
							<button type="button" class="btn btn-default" onclick="search()">查询</button>
						</form>
					</div>
				</div>
			</div>
			<div id="examItem_content">
				<div class="sub_content_table">
					<table
						class="table table-striped table-bordered table-hover datatable"
						id="datatable">
						<thead>
							<tr>
								<th>状态</th>
								<th>教练姓名</th>
								<th>教练电话</th>
								<th>学员姓名</th>
								<th>学员电话</th>
								<th>会员绑定码</th>
								<th>会员OPENID</th>
								<th>预约时间</th>
								<th>练车类型</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>
	<footer_body> <script>
		base.menu.active('menu_204');

		var table = base.datatable.table({
			tableid : '#datatable',
			aoColumns : [ {
				"data" : "status"
			}, {
				"data" : "trainName"
			}, {
				"data" : "trainTel"
			}, {
				"data" : "studentName"
			}, {
				"data" : "contactNumberF"
			}, {
				"data" : "studentKey"
			}, {
				"data" : "studentOpenid"
			}, {
				"data" : "joinTime"
			}, {
				"data" : "joinTime"
			} ],
			columnDefs : [
					{
						targets : 0,
						render : function(a, b, c, d) {
							var ls = c.status == '正常' ? ' label-default'
									: 'label-warning';
							var html = '<span class="label  '+ls +'">'
									+ c.status + '</span>';
							return html;
						}
					}, {
						targets : 7,
						render : function(a, b, c, d) {
							return c.examTime + " " + c.openHours;
						}
					}, {
						targets : 8,
						render : function(a, b, c, d) {

							return c.coachType == 2 ? '科目二' : '科目三';
						}
					} ],
			url : "${ctx}/webCustomer/coach/data?rand=" + Math.random(),
			changeData:function(d){
				 d.key = $('#key').val();
				 return d;
			}
		});

		function search() {
			base.datatable.reloadAjax({
				url : "${ctx}/webCustomer/coach/data?rand=" + Math.random()
			});
		}
	</script> </footer_body>
</body>
</html>